<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
	<script type="text/javascript" src="uploadify/jquery.uploadify-3.1.min.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){ 
		$(function() {
			$('#fotos').uploadify({
				'swf'      : 'uploadify/uploadify.swf',
				'uploader' : 'produto.php?acao=salvar',
				multi:false,
				auto:false,
				uploadLimit:1,
				buttonText:"Selecione a Foto",
				formData:$("#form").serializeArray(),
	'			onUploadSuccess' : function(file, data, response) {
					alert(''+data);
				}

				// Your options here
				
			});
		});
		
		
		$(".data").mask("99/99/9999");
		//Lembrar de colocar disponibilidade de usar menos campos
		$(".num").mask("999");
		$(".cep").mask("99.999-999");
		$(".tel").mask("(99)9999-9999");
		$(".cnpj").mask("99.999.999/9999-99");
		$(".cpf").mask("999.999.999-99");
	});	
	</script>

</head>
<body>\
	<form name="form" id="form" action="" method="post" enctype="multipart/form-data">
		<div class="center_prod_box_big">            
                 
			<div class="contact_form">
				<fieldset>
					<legend>Cadastro de Produtos</legend>    
					
					<div class="form_row">
						<label class="contact"><strong>Nome:</strong></label>
						<input type="text" class="contact_input" value="<?php echo $info['NOME']; ?>" name="nome" id="nome"/>
					</div>  

					<div class="form_row">
						<label class="contact"><strong>Descrição:</strong></label>
						<input type="text" class="contact_input" name="descricao" id="descricao" value="<?php echo $info['DESCRICAO']; ?>"/>
					</div>
                    
                    <div class="form_row">
						<label class="contact"><strong>Fabricante:</strong></label>
						<input type="text" class="contact_input" name="fabricante" id="fabricante" value="<?php echo $info['FABRICANTE']; ?>"/>
					</div>
                    
                    <div class="form_row">
						<label class="contact"><strong>Quantidade em estoque:</strong></label>
						<input type="text" class="contact_input num" value="<?php echo $info['QUANTIDADE_ESTOQUE']; ?>" name="quantidade_estoque" id="quantidade_estoque"/>
					</div>
                    
                    <div class="form_row">
						<label class="contact"><strong>Preço de custo:</strong></label>
						<input type="text" class="contact_input dinheiro" value="<?php echo $info['PRECO_CUSTO']; ?>" name="preco_custo" id="preco_custo"/>
					</div>
                    
                    <div class="form_row">
						<label class="contact"><strong>Preço de venda:</strong></label>
						<input type="text" class="contact_input dinheiro" value="<?php echo $info['PRECO_VENDA']; ?>" name="preco_venda" id="preco_venda"/>
					</div>
                    
                    <div class="form_row">
						<label class="contact"><strong>Validade:</strong></label>
						<input type="text" class="contact_input data" value="<?php echo $info['VALIDADE']; ?>" name="validade" id="validade"/>
					</div>
                    
                    <div class="form_row" >
						<input type="file"  name="fotos" id="fotos" class="contact_input"/>
					</div>
						
					
					<div class="form_row">
						<a href="#" id='salvar' target='' class="prod_details" onClick="$('#fotos').uploadify('upload');return false;">Salvar</a>
						<input type="hidden" id="acao" name="acao" value='<?php echo $info['acao']; ?>' />
					</div>      
				</fieldset>		
			</div>
        </div> 
     </form>        
</body>
</html>
